import { ComponentWithStore } from "mobx-miniprogram-bindings";
import { userStore } from "../../store/userStore";
ComponentWithStore({
  /**
   * 页面的初始数据
   */
  data: {
    cancelLogin: true, // 初始时不弹窗
  },

  // 让页面和store对象建立联系
  storeBindings: {
    store: userStore,
    fields: ["token", "userInfo", "isLogin"],
  },

  methods: {
    infoLookfor(e) {
      // if (!this.data.isLogin) {
      //   this.setData({ cancelLogin: false });
      //   return;
      // }
      wx.navigateTo({
        url: "../lookFor/lookFor",
      });
    },

    infoIdea(e) {
      // if (!this.data.isLogin) {
      //   this.setData({ cancelLogin: false });
      //   return;
      // }
      wx.navigateTo({
        url: "../idea/idea",
      });
    },

    infoLogin() {
      wx.navigateTo({
        url: "../login/login",
      });
    },
    infoCancel() {
      this.setData({
        cancelLogin: true, // 关闭弹窗
      });
    },
    infoMore() {
      wx.navigateTo({
        url: "/pages/aboutWe2/aboutWe2",
      });
    },
    Email_Marketing(e) {
      wx.navigateTo({
        url: "../emailMarketing/emailMarketing",
      });
    },

    onShareTimeline(){
      return{
        title:"组队工具：快组校园小程序",
        query:'/project/projectById/',
        imageUrl:'https://kuaizu-img-file.oss-cn-hangzhou.aliyuncs.com/kuaizu-img/imges/images/background.jpg'
      }
    },

    onShareAppMessage(){
      return{
        title:'组队工具：快组校园小程序',
        path:'pages/index/index',
        imageUrl:''
      }
    },
  },
});
